function  [lle]=ChoiceProb_hom_FEdemoshrt_WTP_tomlab(param)


global state week J T S IST ISTvector K WB...
price_num rebate_estar_num kwh_num elec_num estar_num standard0_num standard10_num standard15_num standard20_num standard25_num rank_num ...
price_denom rebate_estar_denom rebate_denom kwh_denom elec_denom estar_denom standard0_denom standard10_denom standard15_denom standard20_denom standard25_denom rank_denom ...
bchoice bchoice_s bchoice_ij id_i id_j id_ij id_m id_n  demo pidnest choicenest_ij brandweek_denom brandweek_num prod_denom prod_num denom_tmp2 denom_tmp3 denom...
type_id2_3_demo1_num type_id2_3_demo1_denom type_id3_demo1_num type_id3_demo1_denom AV_demo1_num AV_demo1_denom  ice_sc_demo1_num ice_sc_demo1_denom...
type_id2_3_demo2_num type_id2_3_demo2_denom type_id3_demo2_num type_id3_demo2_denom AV_demo2_num AV_demo2_denom  ice_sc_demo2_num ice_sc_demo2_denom...
type_id2_3_demo3_num type_id2_3_demo3_denom type_id3_demo3_num type_id3_demo3_denom AV_demo3_num AV_demo3_denom  ice_sc_demo3_num ice_sc_demo3_denom...
type_id2_3_demo4_num type_id2_3_demo4_denom type_id3_demo4_num type_id3_demo4_denom AV_demo4_num AV_demo4_denom  ice_sc_demo4_num ice_sc_demo4_denom...
type_id2_3_demo5_num type_id2_3_demo5_denom type_id3_demo5_num type_id3_demo5_denom AV_demo5_num AV_demo5_denom  ice_sc_demo5_num ice_sc_demo5_denom...
type_id2_3_demo6_num type_id2_3_demo6_denom type_id3_demo6_num type_id3_demo6_denom AV_demo6_num AV_demo6_denom  ice_sc_demo6_num ice_sc_demo6_denom;

global LLC_5_18;

 %Parameters
  %alpha0=param(1);
  alpha=[0;param(1:J-1,1)];
  eta=param(J,1);
  tau=param(J+1,1);
  pi=param(J+2,1);
  theta=param(J+3,1);
  beta=param(J+4:J+15,1);
  
  FEprod_denom=alpha(prod_denom); 
  FEprod_num=alpha(prod_num); 
   
 %Computations  
 denom_tmp1= FEprod_denom+eta*price_denom+eta*pi*rebate_estar_denom + eta*tau(1)*estar_denom+eta*theta(1)*LLC_5_18*elec_denom...
  				+beta(1)*type_id2_3_demo1_denom +beta(2)*type_id2_3_demo2_denom + beta(3)*type_id2_3_demo3_denom...
  				+beta(4)*type_id2_3_demo4_denom +beta(5)*type_id2_3_demo5_denom + beta(6)*type_id2_3_demo6_denom...
				+beta(7)*AV_demo1_denom +beta(8)*AV_demo2_denom + beta(9)*AV_demo3_denom...
  				+beta(10)*AV_demo4_denom +beta(11)*AV_demo5_denom + beta(12)*AV_demo6_denom;
  				
  denom_tmp2=exp(denom_tmp1);
  denom_tmp3 = sparse(id_i,id_j,denom_tmp2,id_m,id_n)';
  denom=sum(denom_tmp3,2);

  num=FEprod_num+eta*price_num+eta*pi*rebate_estar_num +eta*tau(1)*estar_num+eta*theta(1)*LLC_5_18*elec_num...
  				+beta(1)*type_id2_3_demo1_num +beta(2)*type_id2_3_demo2_num + beta(3)*type_id2_3_demo3_num...
  				+beta(4)*type_id2_3_demo4_num +beta(5)*type_id2_3_demo5_num + beta(6)*type_id2_3_demo6_num...
				+beta(7)*AV_demo1_num +beta(8)*AV_demo2_num + beta(9)*AV_demo3_num...
  				+beta(10)*AV_demo4_num +beta(11)*AV_demo5_num + beta(12)*AV_demo6_num;
  				
  ChoiceProb=exp(num)./denom;
  logChoiceProb=log(ChoiceProb); 
  lle=-sum(logChoiceProb.*bchoice_s,1);
  
  
end 











